package com.sos.entity.po;

import com.sos.entity.dto.UserOrder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.UUID;

/**
 * @author 港某人
 * @date 2021/3/7 14:28
 */
@NoArgsConstructor
@Data
public class Order {

    private String objId;
    private String userAccount;
    private String userName;
    private String doctorId;
    private String doctorName;
    private String createTime;
    private String orderTime;
    private String status;
    private String remark;

    public Order(UserOrder userOrder) {
        this.objId = UUID.randomUUID().toString();
        this.userAccount = userOrder.getAccount();
        this.doctorId = userOrder.getDoctorId();
        this.orderTime = userOrder.getOrderTime();
        this.createTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        this.status = "01";
    }

}
